<?php

namespace app\admin\validate;

use think\Validate;

class ServiceTeam extends Validate
{
    protected $scene = [
        'EditServiceTeam' => ['province_id','city_id','area_id','street_id','team_name','phone','description','top_pic','sort','status'],
    ];

    protected $rule =   [
        'province_id'  => 'require',
        'city_id'  => 'require',
        'area_id'  => 'require',
        'street_id'  => 'require',
        'team_name'  => 'require',
        'phone'  => 'require|mobile',
        'description'  => 'require',
        'top_pic'  => 'require',
        'sort'  => 'require|number|gt:0',
        'status'  => 'require',
    ];

    protected $message  =   [

        'sort'   => [
            'require'   => '排序必须填写',
            'number'    => '请填写正确的数字',
            'gt'    => '数字必须大于 0'
        ],

        'province_id.require' => '省名称必须选择',
        'city_id.require' => '市名称必须选择',
        'area_id.require' => '区名称必须选择',
        'street_id.require' => '街道名称必须选择',
        'team_name.require' => '团队名称必须填写',
        'phone.require' => '团队联系电话必须填写',
        'description.require' => '团队简介必须填写',
        'top_pic.require' => '团队封面图必须填写',
        'status.require' => '状态必须填写',
        'phone.mobile'  => '请输入有效手机号码',
    ];

}
